package com.example.springrabbitmq.listener;

import com.example.springrabbitmq.constants.Constants;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class WorkListener {
    @RabbitListener(queues = Constants.PUBLISH_QUEUE_1)
    public void listenerQueue1(Message message) {
        System.out.println("listener1 接收到消息" + message);
    }

    @RabbitListener(queues = Constants.PUBLISH_QUEUE_2)
    public void listenerQueue2(Message message) {
        System.out.println("listener2 接收到消息" + message);
    }
}
